package com.gimi.cloud.jimi.manage.service.userInfo.Impl;

import com.gimi.cloud.jimi.dao.dao.User.WorkInfoDao;
import com.gimi.cloud.jimi.dto.userInfo.RdWorkInfoDTO;
import com.gimi.cloud.jimi.entity.userInfo.RdWorkInfoEntity;
import com.gimi.cloud.jimi.manage.service.userInfo.WorkInfoService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WorkInfoServiceImpl implements WorkInfoService {
    @Autowired
    private WorkInfoDao workInfoDao;

    @Override
    public RdWorkInfoDTO getUserWorkInfo(RdWorkInfoDTO param) {
        Integer userId = param.getUserId();
        RdWorkInfoEntity workInfoEntity = workInfoDao.selectByUserId(userId);
        RdWorkInfoDTO workInfoDTO = new RdWorkInfoDTO();
        if(workInfoEntity != null) {
            BeanUtils.copyProperties(workInfoEntity, workInfoDTO);
        }
        return workInfoDTO;
    }
}
